import Router from 'koa-router'
import {
  creat_house,
  get_house_info,
  search_join_house,
  get_appid_secret,
  get_openid, } from '../controller/house.js'
import {
  get_err_log,
  input_err_log,
  correct_error } from '../controller/errLog.js'

export const router = app => {
  const router = new Router()
  router.get('/create_house', creat_house)
  //
  router.get('/get_house_info', get_house_info)

  router.get('/search_join_house', search_join_house)

  // 获取微信密钥
  router.get('/get_appid_secret', get_appid_secret)
  // 获取openid

  router.get('/get_openid', get_openid)
  router.get('/get_err_log', get_err_log)
  router.get('/input_err_log', input_err_log)
  router.get('/correct_error', correct_error)

  app.use(router.routes()).use(router.allowedMethods())
}
